Skip to content

Draft: [GOOWOO-492] Implement endpoint to get incentives#3314

Open
jamesmorrison wants to merge 1 commit intofeature/GOOWOO-522-update-google-ads-php-library-to-v23from
feature/GOOWOO-492-implement-endpoint-to-get-incentives
Open

Draft: [GOOWOO-492] Implement endpoint to get incentives#3314
jamesmorrison wants to merge 1 commit intofeature/GOOWOO-522-update-google-ads-php-library-to-v23from
feature/GOOWOO-492-implement-endpoint-to-get-incentives

Conversation

@jamesmorrison
Copy link
Collaborator

Note this started from feature/GOOWOO-522-update-google-ads-php-library-to-v23 (see GOOWOO-522 / PR 3313) as it contained dependent changes (V22 => v23)

The target branch will need updating to [feature/cyoi-phase-1](https://github.com/woocommerce/google-listings-and-ads/tree/feature/cyoi-phase-1) once PR 3313 is merged.

Changes proposed in this Pull Request:

Closes https://linear.app/a8c/issue/GOOWOO-492/implement-endpoint-to-get-incentives

Screenshots:

Screenshot 2026-03-19 at 15 39 00

Detailed test instructions:

  1. Open WP Admin (any page)
  2. Open the Inspector => Console; clear any output
  3. Enter wp.apiFetch({ path: '/wc/gla/ads/incentives' }).then(console.log), press return and wait a few seconds - during this time you should see a pending promise
  4. Validate the returned data, for example:
{
    "type": "CYO_INCENTIVE",
    "termsAndConditionsUrl": "https://ads.google.com/intl/en_uk/home/terms-and-conditions/incentives/?bc=UK&bid=nickel%7Cib:2378556534%7C,sodium%7Cib:1995402192%7C,technetium%7Cib:7056154833%7C",
    "incentives": [
        {
            "id": "2378556534",
            "type": "ACQUISITION",
            "offer": "low",
            "termsAndConditionsUrl": "https://ads.google.com/intl/en_uk/home/terms-and-conditions/incentives/?bc=UK&bid=nickel%7Cib:2378556534%7C",
            "requirement": {
                "spend": {
                    "awardAmount": {
                        "currencyCode": "GBP",
                        "units": "800"
                    },
                    "requiredAmount": {
                        "currencyCode": "GBP",
                        "units": "1250"
                    }
                }
            }
        },
        {
            "id": "1995402192",
            "type": "ACQUISITION",
            "offer": "medium",
            "termsAndConditionsUrl": "https://ads.google.com/intl/en_uk/home/terms-and-conditions/incentives/?bc=UK&bid=sodium%7Cib:1995402192%7C",
            "requirement": {
                "spend": {
                    "awardAmount": {
                        "currencyCode": "GBP",
                        "units": "1600"
                    },
                    "requiredAmount": {
                        "currencyCode": "GBP",
                        "units": "3200"
                    }
                }
            }
        },
        {
            "id": "7056154833",
            "type": "ACQUISITION",
            "offer": "high",
            "termsAndConditionsUrl": "https://ads.google.com/intl/en_uk/home/terms-and-conditions/incentives/?bc=UK&bid=technetium%7Cib:7056154833%7C",
            "requirement": {
                "spend": {
                    "awardAmount": {
                        "currencyCode": "GBP",
                        "units": "2500"
                    },
                    "requiredAmount": {
                        "currencyCode": "GBP",
                        "units": "5000"
                    }
                }
            }
        }
    ]
}

Additional details:

Add - Implement endpoint to get incentives

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant